package com.wengyingjian.weixin.dao;

import com.wengyingjian.weixin.common.model.TbkUrlTransferRecord;
import com.wengyingjian.weixin.dao.mapper.TbkUrlTransferMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * Created by hzwengyingjian on 16/12/27.
 */
@Repository
public class TbkUrlTransferDao {

    @Autowired
    private TbkUrlTransferMapper masterTbkUrlTransferMapper;

    public void update(String wxMsgId, String title) {
        TbkUrlTransferRecord update = new TbkUrlTransferRecord();
        update.setWxMsgId(wxMsgId);
        update.setItemTitle(title);
        masterTbkUrlTransferMapper.updateByWxMsgId(update);
    }

    public TbkUrlTransferRecord selectByTitle(String title) {
        return masterTbkUrlTransferMapper.selectByTitle(title);
    }

    public void insert(TbkUrlTransferRecord insert) {
        masterTbkUrlTransferMapper.insertSelective(insert);
    }

    public void updateById(TbkUrlTransferRecord update) {
        masterTbkUrlTransferMapper.updateById(update);
    }

    public TbkUrlTransferRecord selectByMsgId(String msgId) {
        return masterTbkUrlTransferMapper.selectByMsgId(msgId);
    }
}
